package com.atguigu.jxc.util;

import com.atguigu.jxc.entity.User;
import org.springframework.util.StringUtils;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.net.URLDecoder;

/**
 * 获取登录用户信息类
 */
public class AuthContextHolder {

    /**
     * 获取当前登录用户id
     *
     * @param session
     * @return
     */
    public static User getUserInfo(HttpSession session) {
        User user = (User)session.getAttribute("currentUser");
        return user;
    }
}